mui.init();
mui.plusReady(function() {
	var userModel = getUserModel();
	mui(".div_user_name")[0].innerText = userModel.persName;
	mui(".div_user_address")[0].innerText = userModel.deptName;

	//关于我们
	mui("#li_about")[0].addEventListener("tap", function() {
		//		jumpTo("../../about/about.html","about.html",jumpSlideInRight); 
		mui.toast("暂无开发")
	})

	//版本记录
	mui("#li_upload_record")[0].addEventListener("tap", function() {
		//jumpTo("../../uploadRecord/uploadRecord.html", "uploadRecord.html", jumpSlideInRight);
		mui.toast("暂无开发")
	})

	//扫码下载
	mui("#li_share")[0].addEventListener("tap", function() {
		//jumpTo("../../share/share.html", "share.html", jumpSlideInRight);
		mui.toast("暂无开发")
	})

	//退出登录
	document.getElementById("btn_exit").addEventListener('tap', function() {
		var btnArray = ['取消', '确定'];
		mui.confirm('确定要退出登录吗？', '', btnArray, function(e) {
			if(e.index == 1) {
				//退出登录
				logout();
				//				break;
			} else {
				//				break;
			}
		})
	});

	/**
	 * 退出登录
	 */
	function logout() {
		//	//取消记住密码
		//	setIsRememberPwd('false');
		//删除保存在本地的用户资料
		setUserModel({});
		//当前页面
		var currentWenView = plus.webview.currentWebview();
		//所有已存在的页面
		var allWebView = plus.webview.all();
		//登录页
		var loginView = plus.webview.getLaunchWebview();
		for(var i = 0; i < allWebView.length; i++) {
			//关闭除本页面及登录页外的其他页面
			if(allWebView[i].getURL() == currentWenView.getURL() || allWebView[i].getURL() == loginView.getURL()) {
				continue;
			}
			plus.webview.close(allWebView[i]);

		}

		//刷新登录页
		mui.fire(loginView, "reloadView");
		//关闭当前
		//	plus.nativeUI.showWaiting();
		mui.later(function() {
			//		plus.nativeUI.closeWaiting();
			currentWenView.close()
		}, 300)
	}

})